package com.hanrui.android.fragment.message.threesupervise;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.hanrui.android.R;
import com.hanrui.android.library.base.BaseFragment;
import com.hanrui.android.model.ThreeSuperviseDetailBean;
import com.hanrui.android.net.contract.message.threesupervise.ThreeSuperviseDetailContract;
import com.hanrui.android.net.presenter.message.threesupervise.ThreeSuperviseDetailtPresenter;

import butterknife.BindView;

/**
 * 督办审批基本信息
 *
 */

public class ThreeSuperviseFragment extends BaseFragment<ThreeSuperviseDetailtPresenter> implements ThreeSuperviseDetailContract.View{
    @BindView(R.id.name)
    TextView name;
    @BindView(R.id.thing_title)
    TextView thingTitle;
    @BindView(R.id.time)
    TextView time;
    @BindView(R.id.leaders)
    TextView leaders;
    @BindView(R.id.head_company)
    TextView headCompany;
    @BindView(R.id.duty_company)
    TextView dutyCompany;
    @BindView(R.id.assign_body)
    TextView assignBody;
    @BindView(R.id.duty_people)
    TextView dutyPeople;
    @BindView(R.id.from)
    TextView from;
    @BindView(R.id.work_content)
    TextView workContent;
    @BindView(R.id.reson)
    TextView reson;

    String id;

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_threesupervise;
    }

    @Override
    protected void initInjector() { mFragmentComponent.inject(this); }

    @Override
    protected void initView(View view) {
        id = getArguments().getString("id");

        mPresenter.overSeeThreeDetail(getActivity(),id);
    }



    public static ThreeSuperviseFragment newInstance(String id) {
        ThreeSuperviseFragment fragment = new ThreeSuperviseFragment();
        Bundle bundle = new Bundle();
        bundle.putString("id", id);
        fragment.setArguments(bundle);
        return fragment;
    }

    @Override
    public void overSeeThreeDetail(ThreeSuperviseDetailBean data) {

        if (null != data) {

            name.setText(data.getKeyOverView().getNum());
            thingTitle.setText(data.getKeyOverView().getTitle());
            time.setText(data.getKeyOverView().getFirstDate());
            leaders.setText(data.getKeyOverView().getLeader());
            headCompany.setText(data.getKeyOverView().getSource());
            dutyCompany.setText(data.getKeyOverView().getUnit());
            assignBody.setText(data.getKeyOverView().getOfficeName());
            dutyPeople.setText(data.getKeyOverView().getPrincipal());
            from.setText(data.getKeyOverView().getSourceStatus());
            workContent.setText(data.getKeyOverView().getContent());
            reson.setText(data.getKeyOverView().getRemark());


        		}

    }
}
